package cn.haoxsf.app.system.model.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @program: app 用户注册参数
 * @description:
 * @author: Ele qvbanfm@qq.com
 * @create: 2020-01-07 15:56
 **/
@Data
public class RegisterParam {
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名", required = true, example = "qvbanfm")
    @Pattern(regexp = "^[a-zA-Z]\\w{5,17}", message = "用户名错误：以字母开头，长度在6~18之间，只能包含字符、数字和下划线")
    private String username;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]\\w{5,17}", message = "密码错误：以字母开头，长度在6~18之间，只能包含字符、数字和下划线")
    @ApiModelProperty(value = "密码", required = true, example = "qvbanfm1")
    private String password;
    /**
     * 电话 用于更新用户电话
     */
    @Pattern(regexp = "^1[3|4|5|7|8][0-9]\\d{8}",message = "手机号为空;或者号码不正确")
    @ApiModelProperty(value = "电话",required = true)
    private String phone;

    @NotNull(message = "短信验证码")
    @ApiModelProperty(value = "短信验证码",required = true,example = "6668")
    private String sms;

    @ApiModelProperty(value = "用户地址-只能传中文-可为空", example = "中国")
    private String address;


    @ApiModelProperty(value = "用户经度-可为空", example = "108.328172")
    private String longitude;


    @ApiModelProperty(value = "用户维度-可为空", example = "22.819695")
    private String latitude;
    @ApiModelProperty(value = "微信openid-可为空;用于微信绑定用户时不能为空！此openId从/user/auth/auth2获取 ",example = "")
    private String openId;
}
